var bProductColorWinAdd;
var bProductColorFormAdd;
function addBProductColor(){
	initBProductColorFormAdd();
	bProductColorWinAdd = Ext.create('top.Ext.Window',{
		layout:'fit',
		width:800,
		height:400,
		maximized:true,
		maximizable:true,
		minimizable:true,
		animateTarget:document.body,
		plain:true,
		modal:true,
		title:'添加信息',
		listeners:{
			minimize:function(win,opts){
				win.collapse();
			}
		},
		items:bProductColorFormAdd,
		buttons:[{
			text:'保存',
			itemId:'save',
			handler:function(button){
				submitForm(bProductColorFormAdd,'../bProductColorController/addBProductColor',grid,bProductColorWinAdd,false,true);
			}
		},{
			text:'关闭',
			itemId:'close',
			handler:function(button){
				button.up('window').close();
			}
		}]
	});
	bProductColorWinAdd.show();
	top.Ext.getCmp('b_product_id').setValue($('#b_product_id_').val());
	/**初始化附件右键菜单开始 参数4为1表示拥有上传和删除功能 即新增和编辑页面使用**/
	initTopFileRight('xt_attachment_id','xt_attachment_id_pic',1,1);
	/**初始化附件右键菜单结束**/

}
function initBProductColorFormAdd(){
	bProductColorFormAdd = Ext.create('top.Ext.FormPanel',{
		xtype:'form',
		region:'center',
		waitMsgTarget:true,
		defaultType:'textfield',
		autoScroll:true,
		/**新方法使用开始**/  
        scrollable:true,  
        scrollable:'x',
        scrollable:'y',
        /**新方法使用结束**/ 
		fieldDefaults:{
			labelWidth:77,
			labelAlign:'left',
			flex:1,
			margin:'2 5 4 5'
		},
		items:[
		{
			fieldLabel:'名&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;称',
			xtype:'textfield',
			name:'b_product_color_name',
			maxLength:100,
			anchor:'40%'
		},
		{
			fieldLabel:'图片宽度',
			xtype:'numberfield',
			value:'0',
			name:'b_product_color_width',
			maxLength:10,
			anchor:'40%'
		},
		{
			fieldLabel:'图片高度',
			xtype:'numberfield',
			value:'0',
			name:'b_product_color_height',
			maxLength:10,
			anchor:'40%'
		},
		{
			fieldLabel:'排序编号',
			xtype:'numberfield',
			value:'0',
			name:'b_product_color_sort',
			maxLength:10,
			anchor:'40%'
		},
		{
			fieldLabel:'状&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;态',
			xtype:'combo',
			emptyText:'请选择',
			store:B_PRODUCT_COLOR_STATUS_COMBO_STORE,
			mode:'local',
			triggerAction:'all',
			editable:false,
			hiddenName:'b_product_color_status',
			valueField:'value',
			displayField:'text',
			name:'b_product_color_status',
			maxLength:2,
			anchor:'40%'
		},
		{
			fieldLabel:'商户、卖家编号',
			xtype:'textfield',
			hidden:true,
			id:'b_seller_id',
			name:'b_seller_id',
			maxLength:32,
			anchor:'100%'
		},
		{
			xtype:"fieldcontainer",
			fieldLabel:'&nbsp;&nbsp;商户卖家',
			anchor:'40%',
			layout:'hbox',
			margin:'0 0 0 0',
			items:[{
					xtype:'textfield',
					name:'b_seller_name',
					id:'b_seller_name',
					maxLength:255,
					readOnly:true,
					allowBlank:false,
					anchor:'40%'
				},
		        {
		            xtype:'button',
					text:'选择商户、卖家',
					height:30,
					margin:'3 0 0 0',
					handler:function(button){
						initBsellerGrid();
					}
		        }
		    ]
		},
		{
			fieldLabel:'附件编号',
			xtype:'textfield',
			hidden:true,
			id:'xt_attachment_id',
			name:'xt_attachment_id',
			maxLength:32,
			anchor:'100%'
		},
		{
			title:'上传图片颜色',
			xtype:'fieldset',
			items:{
				xtype:'box', 
				id:'xt_attachment_id_pic', 
				margin:'2 5 4 70', 
				autoEl:{
					tag:'img',
					/** 不采用右键时候直接用点击事件触发
					onclick:"optupload('xt_attachment_id','xt_attachment_id_pic',1)",
					**/
					src:bsdefimg
				}
			}
		},
		{
			fieldLabel:'商品编号',
			xtype:'textfield',
			name:'b_product_id',
			id:'b_product_id',
			maxLength:32,
			hidden:true,
			anchor:'100%'
		},
		{
			fieldLabel:'备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注',
			xtype:'textareafield',
			name:'b_product_color_remark',
			maxLength:200,
			anchor:'100%'
		}
		]
	});
}
